import Vue from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import './plugins/element.js'
import './assets/css/global.css'

import { VueJsonp } from 'vue-jsonp'
Vue.use(VueJsonp)

// 跨域配置
axios.defaults.withCredentials = true
// axios 请求拦截器，request拦截器中显示进度条
axios.interceptors.request.use((config) => {
  NProgress.start()
  return config
})

// 在response拦截器中隐藏进度条
axios.interceptors.response.use((config) => {
  NProgress.done()
  return config
})
Vue.prototype.$axios = axios
Vue.config.productionTip = false

new Vue({
  render: (h) => h(App),
  router
}).$mount('#app')
